package dto

import "apedge/dao"

// 创建节点
type CreateNodeReq struct {
	NodeName     string `json:"nodeName" comment:"节点名称" validate:"required,name-checker"`
	NodeType     string `json:"nodeType" comment:"节点类型" validate:"required"`
	Describe     string `json:"describe" comment:"描述"`
	DeviceSeries string `json:"deviceSeries" comment:"设备序列"`
}

type CreateNodeRsp struct {
	NodeId string `json:"nodeId"`
}

// node 列表
type GetNodeListReq struct {
	PageNum      int64  `form:"pageNum" validate:"required"`
	PageSize     int64  `form:"pageSize" validate:"required"`
	NodeName     string `form:"nodeName"`
	Sort         string `form:"sort"`
	Status       string `form:"status"`
	DeviceSeries string `form:"deviceSeries"`
}

type GetNodeListRsp struct {
	Items []OutApedgeNodeItem `json:"items"`
	Total int64               `json:"total"`
}

// node 详情
type GetNodeDetailReq struct{}

type GetNodeDetailRsp struct {
	OutApedgeNodeItem
}

type OutApedgeNodeItem struct {
	ID                      int64                `json:"id"`
	OrgId                   int64                `json:"orgId"`
	GroupId                 int64                `json:"groupId"`
	UserId                  int64                `json:"userId"`
	UserName                string               `json:"userName"`
	NodeName                string               `json:"nodeName"`
	NodeId                  string               `json:"nodeId"`
	Describe                string               `json:"describe"`
	NodeType                string               `json:"nodeType"`
	Arch                    string               `json:"arch"`
	Cpu                     int64                `json:"cpu"`
	Mem                     int64                `json:"mem"`
	Status                  string               `json:"status"`
	ServiceList             []OutNodeServiceItem `json:"serviceList,omitempty"`
	ServiceNum              int64                `json:"serviceNum"`
	ContainerRuntimeVersion string               `json:"containerRuntimeVersion"`
	DeviceSeries            string               `json:"deviceSeries"`
	OsImage                 string               `json:"osImage"`
	CreatedAt               int64                `json:"createdAt"`
	UpdatedAt               int64                `json:"updatedAt"`
}

type OutNodeServiceItem struct {
	ServiceName   string            `json:"ServiceName"`
	ServiceId     string            `json:"serviceId"`
	ServiceNodeId string            `json:"serviceNodeId"`
	NodeId        string            `json:"nodeId"`
	Status        string            `json:"status"`
	Models        []dao.ApflowModel `json:"models"`
	CreatedAt     int64             `json:"createdAt"`
}

// 删除
type DelNodeReq struct{}

type DelNodeRsp struct{}

// node type
type NodeTypeRsp struct {
	Types []string `json:"nodeTypes"`
}

// 创建证书
type CreateNodeCertReq struct {
	NodeId string `uri:"nodeId" validate:"required"`
}
type CreateNodeCertRsp struct{}

// 安装脚本
type GetInstallScriptReq struct {
	NodeId string `form:"nodeId" validate:"required"`
}

type GetInstallScriptRsp struct {
	Script []string `json:"script"`
}

// 架构类型
type ListArchTypeReq struct{}

type ListArchTypeRsp struct {
	Types []string `json:"types"`
}

// 下载证书
type GetNodeCertificateReq struct {
	NodeId string `uri:"nodeId" validate:"required"`
}

// 下线
type NodeOfflineRsp struct {
	Data string `json:"data"`
}
